(1) Field of the Invention
The present invention relates to a database management program and a computer-readable recording medium having the database management program recorded thereon, and more particularly, to a database management program for managing the use/nonuse of individual unit storage regions of a database by means of a use management book, and to a recording medium having such a database management program recorded thereon.
(2) Description of the Related Art
There has been a demand for techniques that enable a server computer (database server) associated with a database to efficiently access data. As one of such techniques enabling fast access to a database, there is a method wherein a page management book is used to manage the status of use of individual pages each constituting a unit storage region of the database.
FIG. 17 schematically shows a data structure in a conventional database server. The database server 900 comprises a database 910, a dictionary 920, and a page management book 930.
The database 910 includes a plurality of pages 911 to 918 each constituting an input/output unit storage region. The pages 911 to 918 individually store a plurality of records. The dictionary 920 manages definition information (record information, column information, etc.) and status (data accumulation status or backup status) of the database 910. The page management book 930 manages the status of use (allocation/non-allocation) of the individual pages 911 to 918 in the database 910. Specifically, in the page management book 930, flags indicating whether data is allocated to the respective pages 911 to 918 or not are set in association with the page numbers of the respective pages 911 to 918. In the example shown in FIG. 17, dark circle (●) represents a flag indicating data-allocated state and circle (◯) represents a flag indicating blank state (non-allocated state).
With the database server 900 configured as above, by looking up the page management book 930, it is possible to promptly determine which pages in the database 910 are in use and which pages are blank. As a consequence, the database 910 can be accessed efficiently and at high speed.
In the database server 900 described above, it is probable that the content of the page management book 930 is destroyed due to an input/output fault or the like during operation. If such destruction occurs, all pages in the database 910 are looked up to ascertain their status of use. In the process for ascertaining the use status, those pages storing valid data are judged data-allocated pages, while those pages storing invalid data (e.g., data whose values are all “0”) are judged blank pages. The page management book 930 can then be restored in accordance with the results of ascertainment of the contents of data in the individual pages 911 to 918.
Thus, the restoration process for the page management book 930 is executed on the precondition that blank page stores invalid data. To this end, in an initialization process for the database 910, it is essential to physically initialize all pages in the database 910. Physically initializing a page means writing invalid data, as data, into the page. Such physical initialization makes it possible to accurately determine the status of use of the individual pages in the page management book restoration process.
In the initialization process for the conventional database, however, since all pages need to be physically initialized, more and more time is required to initialize the database because the amount of data handled per database server is increasing. Especially, in recent years, the field of business utilizing information communication technology is expanding, entailing an increase in the amount of data handled per database server and consequent enlargement of the scale of databases. As a result, the initialization of a database requires considerable time, and lowers the operation efficiency of the database server.
Among various forms of operation of database server, there is a type wherein operator's operation history is accumulated. For example, in the case of a transaction system for financial institutions, it is necessary that operator's operation history be accumulated in sequence.
A database server for accumulating such operation history generally comprises a plurality of databases. Three databases, for example, are provided such that while the operation history is accumulated in one database, the other two databases are backed up and initialized, respectively. When the initialization of one database is finished, the operation history starts to be accumulated in this database. The database which has been backed up is then reinitialized for the subsequent use, and the database which has accumulated the operation history is backed up upon completion of the accumulation.
Namely, the database server for accumulating the operation history continuously operates in a manner such that the data accumulation, backup, and reinitialization are cyclically carried out with the multiple databases switched. In cases where multiple databases are operated while being switched in this manner, it is necessary that the storage area of the database currently accumulating the operation history should not be exhausted before the initialization of the database which is to accumulate the operation history next is completed.
However, in the case of online transactions conducted in financial business, for example, in which a large amount of operation history is generated, it is difficult to estimate the required capacity of the databases for accumulating the operation history (taking account of time periods needed for the backup operation and the initialization, as well as the operation history generation frequency). Consequently, in order to prevent the storage areas of the databases from being exhausted, a storage capacity much larger than the data capacity actually used needs to be allocated for each of the databases.
Thus, the physical initialization performed at the time of reinitialization of databases lowers the operation efficiency and also constitutes a cause of unnecessary increase in database capacity.
As mentioned above, physical initialization is performed at the time of reinitialization in order that a determination as to whether data has been allocated to the individual pages or not can be made based on the validity of data in the respective pages when the page management book is to be restored. Thus, if the page management book can be restored without checking the validity of data in the individual pages, then physical initialization need not be carried out at the time of reinitialization. If no physical initialization is required at the time of reinitialization, the reinitialization can be completed in a short time even in the case where the scale of databases is enlarged.